using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace tutors_clus.Models.Mapping
{
    public class newsMap : EntityTypeConfiguration<news>
    {
        public newsMap()
        {
            // Primary Key
            this.HasKey(t => t.id_new);

            // Properties
            this.Property(t => t.title_new)
                .HasMaxLength(100);

            this.Property(t => t.image_news)
                .HasMaxLength(100);

            this.Property(t => t.writer_new)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("news");
            this.Property(t => t.id_new).HasColumnName("id_new");
            this.Property(t => t.title_new).HasColumnName("title_new");
            this.Property(t => t.image_news).HasColumnName("image_news");
            this.Property(t => t.create_date_new).HasColumnName("create_date_new");
            this.Property(t => t.writer_new).HasColumnName("writer_new");
            this.Property(t => t.detail_new).HasColumnName("detail_new");
            this.Property(t => t.status_new).HasColumnName("status_new");
            this.Property(t => t.sort).HasColumnName("sort");
        }
    }
}
